NUKEWAR!    for TI-83+       September 10th, 2005 A.D.
V. 3.0
By Tim Callahan
e-mail : callahan.114 at osu dot edu
AIM: CMD Bakotl

CONTENTS:
i. Requirements
1. Features
2. Game Play Instrctions
   a. Map Icons
   b. Menus
3. Bugs
4. Disclaimer
5. Other
6. New in version 3.0


i. Requirements
-Ti-83 plus
-at least 10.3K free RAM MEM
-runs with ION

1.Features

	Nuke War! was developed for TI-83 + (OS version 1.16 on the simulator, and has
been tested with os version 1.13 in ION). It is a two player turn based game in which you
employ spies, research better technology, more powerful nukes, and build atomic weapons
as well as defenses against nuclear attacks. It is somewhat like battleship, only
different and more complex.

2.Game Play

	If you have just downloaded this game onto your calculator, then you will want to
start a new game. At the main menu, select "start new game". You will have an option of having
a human player as Player 1, or have it controlled by a bot.

If you select bot, you will then be asked what strategy it will employ, whether or not you
want to be able to see its moves, and whether or not you want it to be able to change
its strategy during the game. See #6 way down at the bottom of this document for a run down of
what strategies do what.

If you select a human as Player 1, Player one will be asked if they would like to have
their map randomly generated. If player declines, then the player will manually place their
installation on the map. The map is a 7x7 grid, with spaces 8x8. Each player
has the same number of installations to start out with, and no new installations may be
built after the start of the game. The cursor is represented by a flickering box over
the current selected 'tile'. Arrow keys move the cursor. To place a installation, press
the corresponding number on the keypad. The right side of the screen has for each
installation type in this order : the number that the installation correponds to
on the keypad, the installation type, and the number of installations of that type
left to place. For example, to place a nuke silo, move the cursor to the desired
location and press '1' on the pad. No instalation may be placed ontop of another
installation, and no installation may be placed in the ocean. See below for the
tile sprite index. After player one has all his pieces placed, then player two
will place his pieces. This will prety much conclude the set up. The remainder
of the game revolves around menus, although with the luanch nukes and spy operations
there will be more cursor use.

update from basic version: You may also press '9' to pick up a building you have set
down. You are then free to replace the building elsewhere. Pressing enter when all
of your pieces are down confirms that you are happy with you placement.

	a. Map Icons
	There are several sprites for this game. They are all listed below:(the actual
			sprites will be smaller, and look similar, yet different:-)

	  00 00
          00 00
         0000000  
         0     0
         0 0 0 0
         0000000 Factory- Each factory may build two items per
			turn. Each player has 4 to start


	  0
         000 0
         0 0   
         0 0    
         0 0000
        00 0  0 
        0000000-Tech city- Produce $3000 per turn, and each
			city can research one upgrade per turn. Each 
			player starts with 6


       
           0
          0 0
         0   0  
         00000
         0 0 0
        0000000-Farm- Each farm produces $500 per turn. Each
			player starts with 8.


	 0
         00
        00
       00 0 
       000000
       0    0
       000000- ABM site-The ABM(anti Ballistic Missile) sites
			can launch up to one ABM per turn. They are a
			passive weapon, meaning that they will only
			fire if the opponent fires, AND if the
			defending country has their radar station
			intact. Each player starts with 6.





       0000
      00  00
      000000
       0000   -Nuke Silo- Each silo may launch up to one nuke
			per turn, provided that the nukes were already
			in the stockpile. Each player starts with six
			nuke silos.

       0 0 
        0  0
      0000000
      0     0 
      0 0 0 0
      0     0
      0000000 -Spy centers- These are fairly important. Each
			center can do two spy operations per turn, such
			as recon, sabotage, recruiting, and training.
			Each player starts with two.




      0   0
      00 0
      000 
       000     
      00000
      0000000-Radar- VERY IMPORTANT SITE- This instalation
			allows your ABM sites to launch the ABMs at
			incoming Nukes. If your Radar site is
			destroyed, then all you ABM sites become
			useless. Each player starts with one, and the
			maximum sheilding is 50.



       000
      0 0 0 
     0000000- The Command Bunker or CNC- THIS IS THE MOST
			IMPORTANT INSTALLATION-This is essentially you
			base of operations, and where you are during
			the war. Once the Sheilds fail and you bunker
			is destroyed, you lose. If you destroy the
			enemy's bunker, then you win. Each player has
			one bunker, with sheilds at 100.


	OTHER SPRITES: These sprites are also present, and may
			show up.
          0  
      0      0
           0
             0
      0  0   
           0   -Wasteland- This is where a nuke has annihilated
			one of your installations. It is too radioactive
			to reuse.


            0
        0  0 0
       0 0

            0
        0  0 0
       0 0     -ocean- Basically something that is there, you
			can't destroy it, it just takes up space. 
 


	00	
          0 
         0

         0     -unknown terrain- this shows where your spies
			have not reconned.


	b. Menus- in order with descriptions and sub menus:
	
	1. Status menu-View the stats of the various aspects of
		your country

		1.View country- Shows your country map
			and the condition your country is in.
			Pretty much just a picture
		2. Foreign Map- Shows the map that your spies
			have made of the enemy areas they have
			reconned
		3. Structure stat- Shows how many of what
			structure you still have standing, and
			the condition of the shields at your
			radar and CNC
		4. Resources- Shows your money, nukes, ABMs,
			spies, nuke reliability, ABM accuracy,
			and Spy skill
		5. Back-returns to the main menu
	2. Spy menu- Spy onperations and such. You need agents
		for the first two options. The first two are
		not always sucessful, but you can get training
		to increase their chance of sucess.
		2. Train- Increases your agent skill, and
			success likeleyhood on an
			operation.costs $3000 to raise it 3
			points, with a 100 point max.
		1. Recruit- Costs $2000. Gives you 0-15 new
			agents
		3. Recon-Reveals the installation at the
			location. Use the cursor to select the
			area to send agents to, the press
			enter. Generally more successful than
			sabotage.
		4. Sabotage- Select a already reconed site to
			send agents to. The effect of the
			attemps varies from instalation type to
			type. Sometimes resulting in the
			destruction of that site
		5. Back-return to the main menu.
	3. City menu-Operations that the tech cities can do
		1.+Nuke reliab.- for $3000 you can increase
			your nuke reliability by 5%. This make
			is more likely that the nuke will
			actually luanch and later arm itself
			and detonat when it reaches the target.
		2.+ABM Accur.- for $xxxx you can increase by 5%
			your ABM accuracy. This increases the
			likelyhood that an ABM will collide
			with and destroy an incoming nuke.
		3.+Nuke yeild- For $xxxx you can make each nuke
			you fire deal 5 more damage to sheilded
			sites. This is good if you can only get
			a few nukes through the ABM defenses.
			The yeild will deal that many damage to
			the sheilds of a radar or CNC.
		4. Back- return to the main menu
	4. Factory menu
		1.Build Nuke- for $xxxx you can build your very
			own nuclear warhead. If you don't have
			nukes, you can't attack. When you order
			a nuke, it will not be available for
			launch until your next turn. ie you
			have three nukes at the start of your
			turn, your order five, you still can
			only fire three nukes total that turn.
		2. Build ABM- for $xxxx you can build an ABM,
			which is the only defense you can have
			to protect agains incoming nuclear
			warheads. It is recommended that you
			have at least the same amount of ABMs
			available as you have ABM sites.
		3.Repair Radar-fully repair radar sheilding,
			the price varies, and it is important
			the the shield be at their max of fifty
			to decrease the likelyhood that they
			will be destroyed by one or two
			incoming nukes.
		4. Repair CNC- Fully repair the CNC sheilding.
			This is very important to do, since
			attrition damage can mount up very
			quickly. The price to fully repair varies.
		5. Return- Again, returns you to the main
			menu.
	5. Launch strike- You select where you want to fire nukes at on the foreign map.
		Tiles that have already been targeted in the past by a strike will be inverse
		of the normal tile for that building or space.
	6. End turn-This ends your turn, and prepares for the
		next players turn. A thing will come up saying whose turn it is.
		NEW IN THIS VERSION: First thing before you can play with menues
		is the beginning of turn report. This report tells the player
		what research and construction is completed. It also reports of
		enemy spies being captured. The final element is the incoming
		warhead message. If the player still has a radar and some abms, then
		they can fire some to defend. No radar or ABMs, and the nukes get through.
		It's pretty self explanatory once you see the message.
	7.Quit- this saves the current game and terminates the execution of the
		program. Thats about it for this one 

-Now you should be ready to play. If you can't figure something out, just e-mail me.
I'll try to answer your questions. 


3. Bugs

There are one or two things in the gameplay that might be refered to as bugs, but
as far as I know they are more like 'cheats', since I am faily sure they will not
cause the calc to crash.

There should be no bugs in the game, but it is possible that some were overlooked while
the game was being tested and developed.
If there is any bug you do discover, then let me know. Send an e-mail
with the game version number, where the bug occurred, and anything else that would
be relevent in fixing the problem. 
E-mail me at the address at the top of this document if you have any other
questions, concerns, comments, or bug reports. Thanks.

4. Disclaimer

This program and any of all of its components should not cause any crashes of other
problems such as ram clear, damage or thermonuclear meltdown to your device. If such
problem does occur, then by using the program the programmer assumes no liability
for the damage. 
YOU USE THIS PROGRAM AND ITS COMPONENTS AT YOUR OWN RISK.

5. Other

In case you hadn't noticed, most of this documentation is the same as teh readme for the
BASIC version of this game. That's because a) it mostly still pertains, and b) I'm lazy
and didnt feel like retyping a whole bunch of stuff. I did reflect some changes to the
gameplay in this version of the manual, but there could be one or two things I've overlooked.
If I did, I'm sure you can figure out how to play the game anyway.
This is my first assembly game, so I did it entirely in assembly. I decided to try a port to
ION, gave up, then tried again. So this runs under ION or compatable. Due to the size of
the program, it can no longer be run from the command line using the Asm() operation.

Source code is being included with this game, because I am (most likely) done developing it
(for now (if you've read version 2.0's readme, my response to that is "I changed my mind a few
days afterwards"))

[the below really aplies more to v 2.0  The upgrades for v 3.0 were planned out much much
better, and as a result I was able to get the coding and testing done in about three weeks of
the 2k assembled code segment that makes up the bot]

Hopefully, if you're learning ASM (like I still am), you'll be able to look your
way through all the code, comments, and commented swearing and learn something from it.
Mainly, that this was a terribly planned program, and that it is a VERY GOOD IDEA to
carefully plan out what you want and how you want to do it, before you actually start
writing the code. I did not do this for a few reasons.
1) I thought that this would be a relatively simple program that wouldn't need much planning
2) There was a year gap between giving up the program in frustration and then finally
   picking it up again with the determination to make it a finished POS
3) I did not want to rewrite what I already had coded a year ago, and decided to continue
   using the same convention (all the code in one file---this is a very very messing and
   bad thing to do if you want to have everything organized and make things simple to test)
4) I wanted to make an example of 'spaghetti code' for people to see. The code goes almost
   everywhere and is not easy to understand, even with all my comments and swearing

So in summary, good programming practices are (whether ASM or C or Bob's Programming Language):
1) Break things up into smaller, easily tested 'modules.' Break things down as small as possible,
	it helps with debugging and testing. Also, know exactly what your modules (or
	subroutines) or components do. How is all up to implementation.
2) Comments are your friend
3) Plan first, Code second
4) You can save hours of planning with weeks of programming. You can also save weeks of
	programming with hours of planning.

Also, feel free to reuse the code or whatnot, just give me credit where due.

Oh, one other thing you might notice. The graphic at the beginning of the game says version 1.0,
while the intro text says v 2.0. That's because the picture is the first version of the picture,
and the game itself is the second version. (Well, actually, I was too lazy to try and
figure out where in the hex code to change what to make that one a two.)

And thank you for chosing Nukewar for whatever your needs were.


6. New in version 3.0

Many optimizations were done which reduced the original size of the game to just under 7k.
However, Many new features were added, which has made the final size swell to a few cents over
10k. What could I possibly have done to fatten the program by 3k? Did I add nifty animations?
No. Not in this version.

The purpose of this version was to optimize the original code and add bot players so that
the user would not have to play against themself. I also added a check to see if both players
can still attack each other with nuclear weapons. Basically, if there is no way either player
can destroy the command center of the other, the game ends in stalemate.

A breif description of the strategy modes the bot/AI can use:

defensive: The bot will never attack with nuclear weapons. Instead, it focuses on spies to
	locate and destory enemy silos. It also spends resources on its ABM sheild, maximizing
	the accuracy of it as soon as possible to repel all incoming nukes.

offensive: Possibly stupid, possibly a geneious. All it cares about is increasing the
	reliability and yield of its nuclear weapons. It cares not for spies, but rather
	destroying as much of the other country as possible, and hopefully destroying the enemy
	command center with it.

moderate: In between defenseive and offensive. Increases the reliability and accuracy of
	its nukes and ABMs respectively. It also makes use of spies to locate and destroy
	potential targets in the enemy's country.


adaptable: Just means that the bot can change its strategy if the current one isn't working to
	well. Such as if its offensive and all its nukes are beign intercepted, then it will
	change to a different strategy.

permanent: No matter what, the bot will stick with its strategy. Even if its a really bad one
	which might make for a very, very short game.